from enum import Enum
from typing import Union

from pydantic import Field

from app.schemas.common import DateTimeModelMixin


class AdStatus(str, Enum):
    start = 1
    end = 0


class AdSM(DateTimeModelMixin):
    slot_id: Union[int, None]
    title: Union[str, None]
    target_url: Union[str, None]
    image_url: Union[str, None]
    status: Union[AdStatus, None] = Field(default=AdStatus.start)

    class Config:
        orm_mode: True


class AdSlotSM(DateTimeModelMixin):
    name: Union[str, None]
    width: Union[int, None]
    height: Union[int, None]

    class Config:
        orm_mode: True
